<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Tolc: app/common/utils_cms.php File Reference</title>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../jquery.js"></script>
<script type="text/javascript" src="../../dynsections.js"></script>
<link href="../../navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../resize.js"></script>
<script type="text/javascript" src="../../navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="../../tolc_logo.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">Tolc
   &#160;<span id="projectnumber">v 1.00</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.2 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "../../search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="../../index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="../../pages.html"><span>Related&#160;Pages</span></a></li>
      <li class="current"><a href="../../files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="../../search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="../../search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="../../files.html"><span>File&#160;List</span></a></li>
      <li><a href="../../globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('d6/dfd/utils__cms_8php.html','../../');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Pages</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">utils_cms.php File Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p><a href="../../d6/dfd/utils__cms_8php_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a899c67acb078ad12251b58324cf23ad0"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d6/dfd/utils__cms_8php.html#a899c67acb078ad12251b58324cf23ad0">get_user</a> ($conn, $username)</td></tr>
<tr class="separator:a899c67acb078ad12251b58324cf23ad0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0e7b1a668980c1d449a65ae6da0fcecc"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d6/dfd/utils__cms_8php.html#a0e7b1a668980c1d449a65ae6da0fcecc">get_page</a> ($conn, $url)</td></tr>
<tr class="separator:a0e7b1a668980c1d449a65ae6da0fcecc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aaf350858e67bd33880c8b40a06d2e376"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d6/dfd/utils__cms_8php.html#aaf350858e67bd33880c8b40a06d2e376">get_page_version</a> ($conn, $page_id, $dt, $content_status, $use_all_versions=false)</td></tr>
<tr class="separator:aaf350858e67bd33880c8b40a06d2e376"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9f54a511e68e3e64b7c61ecd1c908989"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d6/dfd/utils__cms_8php.html#a9f54a511e68e3e64b7c61ecd1c908989">get_page_template</a> ($conn, $page_id, $dt)</td></tr>
<tr class="separator:a9f54a511e68e3e64b7c61ecd1c908989"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a37351479f5cec7a9e50873f3f7f44490"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d6/dfd/utils__cms_8php.html#a37351479f5cec7a9e50873f3f7f44490">get_first_template_date</a> ($conn, $page_id, $str_timezone)</td></tr>
<tr class="separator:a37351479f5cec7a9e50873f3f7f44490"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6b786ebb8257b1815166cdaa1f7f1a2c"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d6/dfd/utils__cms_8php.html#a6b786ebb8257b1815166cdaa1f7f1a2c">set_template_src_attribute</a> ($html, $template_base_url)</td></tr>
<tr class="separator:a6b786ebb8257b1815166cdaa1f7f1a2c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab025d281a8114b37826d621f93b8fb70"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d6/dfd/utils__cms_8php.html#ab025d281a8114b37826d621f93b8fb70">parse_template_head</a> ($html, $template_base_url)</td></tr>
<tr class="separator:ab025d281a8114b37826d621f93b8fb70"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7ceb917fb4bd67db7f6be554347747fc"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d6/dfd/utils__cms_8php.html#a7ceb917fb4bd67db7f6be554347747fc">get_template_active_elements</a> ($conn, $template_id)</td></tr>
<tr class="separator:a7ceb917fb4bd67db7f6be554347747fc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af1067f0f5a7357c706ca40d229d1f4ac"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d6/dfd/utils__cms_8php.html#af1067f0f5a7357c706ca40d229d1f4ac">set_page_version_content</a> ($conn, $page_version_id, $template_id, $html)</td></tr>
<tr class="separator:af1067f0f5a7357c706ca40d229d1f4ac"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af95a0717c669315235da4fb362691905"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d6/dfd/utils__cms_8php.html#af95a0717c669315235da4fb362691905">get_page_version_content_from_string</a> ($conn, $template_id, $str_html)</td></tr>
<tr class="separator:af95a0717c669315235da4fb362691905"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="a37351479f5cec7a9e50873f3f7f44490"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">get_first_template_date </td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$conn</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$page_id</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$str_timezone</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Get first template date_start for given page and timezone in format YYYYMMDDHHMMSS</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">$conn</td><td></td></tr>
    <tr><td class="paramname">$page_id</td><td></td></tr>
    <tr><td class="paramname">$str_timezone</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>mixed </dd></dl>

<p>Definition at line <a class="el" href="../../d6/dfd/utils__cms_8php_source.html#l00178">178</a> of file <a class="el" href="../../d6/dfd/utils__cms_8php_source.html">utils_cms.php</a>.</p>

<p>References <a class="el" href="../../d5/d3e/ajax__autocomplete__parent__title_8php_source.html#l00026">$conn</a>, <a class="el" href="../../d0/d3d/ajax__new__page_8php_source.html#l00029">$date_start</a>, <a class="el" href="../../d7/da6/ajax__datetime__range_8php_source.html#l00026">$dt</a>, <a class="el" href="../../d0/d3d/ajax__new__page_8php_source.html#l00037">$rs</a>, and <a class="el" href="../../d0/d3d/ajax__new__page_8php_source.html#l00036">$sql</a>.</p>
<div class="fragment"><div class="line">                                                                 {</div>
<div class="line"></div>
<div class="line">        <a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a047170d6020a882807665812a27e2525">$sql</a> = <span class="stringliteral">&#39;SELECT date_start FROM www_page_templates WHERE www_pages_id=&#39;</span> . $page_id . <span class="stringliteral">&#39; ORDER BY date_start&#39;</span>;</div>
<div class="line">        <a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a801399e74a9ffbd3985c323da20bb59e">$rs</a> = <a class="code" href="../../d5/d3e/ajax__autocomplete__parent__title_8php.html#aa8a5a87b9c1a6a0819b88447cbe41877">$conn</a>-&gt;SelectLimit(<a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a047170d6020a882807665812a27e2525">$sql</a>, 1, 0);</div>
<div class="line">        <span class="keywordflow">if</span>(<a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a801399e74a9ffbd3985c323da20bb59e">$rs</a> === <span class="keyword">false</span>) {</div>
<div class="line">                trigger_error(<span class="stringliteral">&#39;Wrong SQL: &#39;</span> . <a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a047170d6020a882807665812a27e2525">$sql</a> . <span class="stringliteral">&#39; Error: &#39;</span> . <a class="code" href="../../d5/d3e/ajax__autocomplete__parent__title_8php.html#aa8a5a87b9c1a6a0819b88447cbe41877">$conn</a>-&gt;ErrorMsg(), E_USER_ERROR);</div>
<div class="line">        } <span class="keywordflow">else</span> {</div>
<div class="line">                <a class="code" href="../../d0/d3d/ajax__new__page_8php.html#adffe3566fa44610a67a94146a30304ba">$date_start</a> = <a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a801399e74a9ffbd3985c323da20bb59e">$rs</a>-&gt;fields[<span class="stringliteral">&#39;date_start&#39;</span>];</div>
<div class="line">        }</div>
<div class="line"></div>
<div class="line">        <a class="code" href="../../d7/da6/ajax__datetime__range_8php.html#a749423b4cd05e9c9af3474b05bec92c2">$dt</a> = DateTime::createFromFormat(<span class="stringliteral">&#39;YmdHis&#39;</span>, <a class="code" href="../../d0/d3d/ajax__new__page_8php.html#adffe3566fa44610a67a94146a30304ba">$date_start</a>);</div>
<div class="line">    <a class="code" href="../../d7/da6/ajax__datetime__range_8php.html#a749423b4cd05e9c9af3474b05bec92c2">$dt</a>-&gt;setTimezone(<span class="keyword">new</span> DateTimeZone($str_timezone));</div>
<div class="line">        <span class="keywordflow">return</span> <a class="code" href="../../d7/da6/ajax__datetime__range_8php.html#a749423b4cd05e9c9af3474b05bec92c2">$dt</a>-&gt;format(<span class="stringliteral">&#39;YmdHis&#39;</span>);</div>
<div class="line">}</div>
</div><!-- fragment -->
</div>
</div>
<a class="anchor" id="a0e7b1a668980c1d449a65ae6da0fcecc"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">get_page </td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$conn</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$url</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Get page properties</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">$conn</td><td></td></tr>
    <tr><td class="paramname">$url</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>array </dd></dl>

<p>Definition at line <a class="el" href="../../d6/dfd/utils__cms_8php_source.html#l00036">36</a> of file <a class="el" href="../../d6/dfd/utils__cms_8php_source.html">utils_cms.php</a>.</p>

<p>References <a class="el" href="../../d5/d3e/ajax__autocomplete__parent__title_8php_source.html#l00026">$conn</a>, <a class="el" href="../../d0/d3d/ajax__new__page_8php_source.html#l00027">$page_title</a>, <a class="el" href="../../d0/d3d/ajax__new__page_8php_source.html#l00037">$rs</a>, <a class="el" href="../../d0/d3d/ajax__new__page_8php_source.html#l00036">$sql</a>, <a class="el" href="../../de/dc4/settings_8dist_8php_source.html#l00011">$tolc_conf</a>, and <a class="el" href="../../db/ded/ajax__user_8php_source.html#l00037">$url</a>.</p>
<div class="fragment"><div class="line">                               {</div>
<div class="line"></div>
<div class="line">        global <a class="code" href="../../de/dc4/settings_8dist_8php.html#af21c418e4c577deb3a9ea7299156ae35">$tolc_conf</a>;</div>
<div class="line"></div>
<div class="line">        <span class="comment">// get page properties (CASE INSENSITIVE URL search)</span></div>
<div class="line">        <span class="keywordflow">if</span>(!$tolc_conf[<span class="stringliteral">&#39;pref_use_prepared_statements&#39;</span>]) {</div>
<div class="line">                <a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a047170d6020a882807665812a27e2525">$sql</a> = <span class="stringliteral">&#39;SELECT id, title, is_removed FROM www_pages WHERE LOWER(url)=&#39;</span> . <a class="code" href="../../d5/d3e/ajax__autocomplete__parent__title_8php.html#aa8a5a87b9c1a6a0819b88447cbe41877">$conn</a>-&gt;qstr(mb_strtolower(<a class="code" href="../../db/ded/ajax__user_8php.html#acf215f34a917d014776ce684a9ee8909">$url</a>));</div>
<div class="line">                <a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a801399e74a9ffbd3985c323da20bb59e">$rs</a> = <a class="code" href="../../d5/d3e/ajax__autocomplete__parent__title_8php.html#aa8a5a87b9c1a6a0819b88447cbe41877">$conn</a>-&gt;Execute(<a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a047170d6020a882807665812a27e2525">$sql</a>);</div>
<div class="line">        } <span class="keywordflow">else</span> {</div>
<div class="line">                <a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a047170d6020a882807665812a27e2525">$sql</a> = <span class="stringliteral">&#39;SELECT id, title, is_removed FROM www_pages WHERE LOWER(url)=?&#39;</span>;</div>
<div class="line">                $pst = <a class="code" href="../../d5/d3e/ajax__autocomplete__parent__title_8php.html#aa8a5a87b9c1a6a0819b88447cbe41877">$conn</a>-&gt;Prepare(<a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a047170d6020a882807665812a27e2525">$sql</a>);</div>
<div class="line">                <a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a801399e74a9ffbd3985c323da20bb59e">$rs</a> = <a class="code" href="../../d5/d3e/ajax__autocomplete__parent__title_8php.html#aa8a5a87b9c1a6a0819b88447cbe41877">$conn</a>-&gt;Execute($pst, array(mb_strtolower(<a class="code" href="../../db/ded/ajax__user_8php.html#acf215f34a917d014776ce684a9ee8909">$url</a>)));</div>
<div class="line">        }</div>
<div class="line">        <span class="keywordflow">if</span>(<a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a801399e74a9ffbd3985c323da20bb59e">$rs</a> === <span class="keyword">false</span>) {</div>
<div class="line">                trigger_error(<span class="stringliteral">&#39;Wrong SQL: &#39;</span> . <a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a047170d6020a882807665812a27e2525">$sql</a> . <span class="stringliteral">&#39; Error: &#39;</span> . <a class="code" href="../../d5/d3e/ajax__autocomplete__parent__title_8php.html#aa8a5a87b9c1a6a0819b88447cbe41877">$conn</a>-&gt;ErrorMsg(), E_USER_ERROR);</div>
<div class="line">        }</div>
<div class="line"></div>
<div class="line">        <span class="keywordflow">if</span>(<a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a801399e74a9ffbd3985c323da20bb59e">$rs</a>-&gt;RecordCount() == 0) {</div>
<div class="line">                $page_id = 0;</div>
<div class="line">                <a class="code" href="../../d0/d3d/ajax__new__page_8php.html#ace7d5ca2414fbd4f411985155fe2f643">$page_title</a> = null;</div>
<div class="line">                $page_has_been_removed = null;</div>
<div class="line">        } <span class="keywordflow">else</span> {</div>
<div class="line">                $page_id = <a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a801399e74a9ffbd3985c323da20bb59e">$rs</a>-&gt;fields[<span class="stringliteral">&#39;id&#39;</span>];</div>
<div class="line">                <a class="code" href="../../d0/d3d/ajax__new__page_8php.html#ace7d5ca2414fbd4f411985155fe2f643">$page_title</a> = <a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a801399e74a9ffbd3985c323da20bb59e">$rs</a>-&gt;fields[<span class="stringliteral">&#39;title&#39;</span>];</div>
<div class="line">                $page_has_been_removed = <a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a801399e74a9ffbd3985c323da20bb59e">$rs</a>-&gt;fields[<span class="stringliteral">&#39;is_removed&#39;</span>] == 1 ? <span class="keyword">true</span> : <span class="keyword">false</span>;</div>
<div class="line">        }</div>
<div class="line"></div>
<div class="line">        <span class="keywordflow">return</span> array(</div>
<div class="line">                <span class="stringliteral">&#39;page_id&#39;</span> =&gt; $page_id,</div>
<div class="line">                <span class="stringliteral">&#39;page_title&#39;</span> =&gt; <a class="code" href="../../d0/d3d/ajax__new__page_8php.html#ace7d5ca2414fbd4f411985155fe2f643">$page_title</a>,</div>
<div class="line">                <span class="stringliteral">&#39;page_has_been_removed&#39;</span> =&gt; $page_has_been_removed</div>
<div class="line">        );</div>
<div class="line"></div>
<div class="line">}</div>
</div><!-- fragment -->
</div>
</div>
<a class="anchor" id="a9f54a511e68e3e64b7c61ecd1c908989"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">get_page_template </td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$conn</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$page_id</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$dt</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Get template_id for a page in certain time</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">$conn</td><td></td></tr>
    <tr><td class="paramname">$page_id</td><td></td></tr>
    <tr><td class="paramname">$dt</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>array </dd></dl>

<p>Definition at line <a class="el" href="../../d6/dfd/utils__cms_8php_source.html#l00127">127</a> of file <a class="el" href="../../d6/dfd/utils__cms_8php_source.html">utils_cms.php</a>.</p>

<p>References <a class="el" href="../../d7/da6/ajax__datetime__range_8php_source.html#l00031">$a_res</a>, <a class="el" href="../../d5/d3e/ajax__autocomplete__parent__title_8php_source.html#l00026">$conn</a>, <a class="el" href="../../d9/d37/ajax__load__page__version_8php_source.html#l00180">$css_url</a>, <a class="el" href="../../d7/da6/ajax__datetime__range_8php_source.html#l00026">$dt</a>, <a class="el" href="../../d0/d3d/ajax__new__page_8php_source.html#l00037">$rs</a>, <a class="el" href="../../d0/d3d/ajax__new__page_8php_source.html#l00036">$sql</a>, <a class="el" href="../../d9/d37/ajax__load__page__version_8php_source.html#l00179">$template_file</a>, <a class="el" href="../../db/d3f/ajax__addnew__page__version_8php_source.html#l00055">$template_id</a>, <a class="el" href="../../d9/d37/ajax__load__page__version_8php_source.html#l00178">$template_path</a>, and <a class="el" href="../../de/dc4/settings_8dist_8php_source.html#l00011">$tolc_conf</a>.</p>
<div class="fragment"><div class="line">                                                 {</div>
<div class="line"></div>
<div class="line">        global <a class="code" href="../../de/dc4/settings_8dist_8php.html#af21c418e4c577deb3a9ea7299156ae35">$tolc_conf</a>;</div>
<div class="line">        $dt_safe = <a class="code" href="../../d5/d3e/ajax__autocomplete__parent__title_8php.html#aa8a5a87b9c1a6a0819b88447cbe41877">$conn</a>-&gt;qstr(<a class="code" href="../../d7/da6/ajax__datetime__range_8php.html#a749423b4cd05e9c9af3474b05bec92c2">$dt</a>);</div>
<div class="line"></div>
<div class="line">        <span class="keywordflow">if</span>($page_id == 0) {</div>
<div class="line">                <span class="comment">// set default template id</span></div>
<div class="line">                <a class="code" href="../../db/d3f/ajax__addnew__page__version_8php.html#a244cfb00f58fe64d22802920d642cf8a">$template_id</a> = $tolc_conf[<span class="stringliteral">&#39;domains_tmpl&#39;</span>][$_SERVER[<span class="stringliteral">&#39;SERVER_NAME&#39;</span>]];</div>
<div class="line">        } <span class="keywordflow">else</span> {</div>
<div class="line">                <span class="comment">// get template id</span></div>
<div class="line">                <a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a047170d6020a882807665812a27e2525">$sql</a> = <span class="stringliteral">&#39;SELECT www_templates_id FROM www_page_templates &#39;</span> .</div>
<div class="line">                        <span class="stringliteral">&#39;WHERE www_pages_id=&#39;</span> . $page_id .</div>
<div class="line">                        <span class="stringliteral">&#39; AND date_start&lt;=&#39;</span> . $dt_safe .</div>
<div class="line">                        <span class="stringliteral">&#39; ORDER BY date_start DESC&#39;</span>;</div>
<div class="line">                <a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a801399e74a9ffbd3985c323da20bb59e">$rs</a> = <a class="code" href="../../d5/d3e/ajax__autocomplete__parent__title_8php.html#aa8a5a87b9c1a6a0819b88447cbe41877">$conn</a>-&gt;SelectLimit(<a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a047170d6020a882807665812a27e2525">$sql</a>, 1, 0);</div>
<div class="line">                <span class="keywordflow">if</span>(<a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a801399e74a9ffbd3985c323da20bb59e">$rs</a> === <span class="keyword">false</span>) {</div>
<div class="line">                        trigger_error(<span class="stringliteral">&#39;Wrong SQL: &#39;</span> . <a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a047170d6020a882807665812a27e2525">$sql</a> . <span class="stringliteral">&#39; Error: &#39;</span> . <a class="code" href="../../d5/d3e/ajax__autocomplete__parent__title_8php.html#aa8a5a87b9c1a6a0819b88447cbe41877">$conn</a>-&gt;ErrorMsg(), E_USER_ERROR);</div>
<div class="line">                } <span class="keywordflow">else</span> {</div>
<div class="line">                        <a class="code" href="../../db/d3f/ajax__addnew__page__version_8php.html#a244cfb00f58fe64d22802920d642cf8a">$template_id</a> = <a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a801399e74a9ffbd3985c323da20bb59e">$rs</a>-&gt;fields[<span class="stringliteral">&#39;www_templates_id&#39;</span>];</div>
<div class="line">                }</div>
<div class="line">        }</div>
<div class="line"></div>
<div class="line">        <span class="comment">// get template properties</span></div>
<div class="line">        <a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a047170d6020a882807665812a27e2525">$sql</a> = <span class="stringliteral">&#39;SELECT template_path, template_file, css_url FROM www_templates WHERE id = &#39;</span> . <a class="code" href="../../db/d3f/ajax__addnew__page__version_8php.html#a244cfb00f58fe64d22802920d642cf8a">$template_id</a>;</div>
<div class="line">        <a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a801399e74a9ffbd3985c323da20bb59e">$rs</a> = <a class="code" href="../../d5/d3e/ajax__autocomplete__parent__title_8php.html#aa8a5a87b9c1a6a0819b88447cbe41877">$conn</a>-&gt;Execute(<a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a047170d6020a882807665812a27e2525">$sql</a>);</div>
<div class="line">        <span class="keywordflow">if</span>(<a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a801399e74a9ffbd3985c323da20bb59e">$rs</a> === <span class="keyword">false</span>) {</div>
<div class="line">                trigger_error(<span class="stringliteral">&#39;Wrong SQL: &#39;</span> . <a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a047170d6020a882807665812a27e2525">$sql</a> . <span class="stringliteral">&#39; Error: &#39;</span> . <a class="code" href="../../d5/d3e/ajax__autocomplete__parent__title_8php.html#aa8a5a87b9c1a6a0819b88447cbe41877">$conn</a>-&gt;ErrorMsg(), E_USER_ERROR);</div>
<div class="line">        }</div>
<div class="line">        <a class="code" href="../../d9/d37/ajax__load__page__version_8php.html#a9ba5b535b139c92dc36ac5c9b8c18186">$template_path</a> = <a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a801399e74a9ffbd3985c323da20bb59e">$rs</a>-&gt;fields[<span class="stringliteral">&#39;template_path&#39;</span>];</div>
<div class="line">        <a class="code" href="../../d9/d37/ajax__load__page__version_8php.html#a81a0f5ac832f9296d427080af9383791">$template_file</a> = <a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a801399e74a9ffbd3985c323da20bb59e">$rs</a>-&gt;fields[<span class="stringliteral">&#39;template_file&#39;</span>];</div>
<div class="line">        <a class="code" href="../../d9/d37/ajax__load__page__version_8php.html#a17fffe823c0351a4c73f199924a0f641">$css_url</a> = <a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a801399e74a9ffbd3985c323da20bb59e">$rs</a>-&gt;fields[<span class="stringliteral">&#39;css_url&#39;</span>];</div>
<div class="line"></div>
<div class="line">        <a class="code" href="../../d7/da6/ajax__datetime__range_8php.html#a021631687090fc455607ae336ebc3b54">$a_res</a> = array(</div>
<div class="line">                <span class="stringliteral">&#39;template_id&#39;</span> =&gt; <a class="code" href="../../db/d3f/ajax__addnew__page__version_8php.html#a244cfb00f58fe64d22802920d642cf8a">$template_id</a>,</div>
<div class="line">                <span class="stringliteral">&#39;template_path&#39;</span> =&gt; <a class="code" href="../../d9/d37/ajax__load__page__version_8php.html#a9ba5b535b139c92dc36ac5c9b8c18186">$template_path</a>,</div>
<div class="line">                <span class="stringliteral">&#39;template_file&#39;</span> =&gt; <a class="code" href="../../d9/d37/ajax__load__page__version_8php.html#a81a0f5ac832f9296d427080af9383791">$template_file</a>,</div>
<div class="line">                <span class="stringliteral">&#39;css_url&#39;</span> =&gt; <a class="code" href="../../d9/d37/ajax__load__page__version_8php.html#a17fffe823c0351a4c73f199924a0f641">$css_url</a></div>
<div class="line">        );</div>
<div class="line"></div>
<div class="line">        <span class="keywordflow">return</span> <a class="code" href="../../d7/da6/ajax__datetime__range_8php.html#a021631687090fc455607ae336ebc3b54">$a_res</a>;</div>
<div class="line">}</div>
</div><!-- fragment -->
</div>
</div>
<a class="anchor" id="aaf350858e67bd33880c8b40a06d2e376"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">get_page_version </td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$conn</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$page_id</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$dt</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$content_status</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$use_all_versions</em> = <code>false</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Get page version id for given datetime and content status</p>
<p>If $use_all_versions, just return the last version</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramtype"></td><td class="paramname">$conn</td><td></td></tr>
    <tr><td class="paramtype"></td><td class="paramname">$page_id</td><td></td></tr>
    <tr><td class="paramtype"></td><td class="paramname">$dt</td><td></td></tr>
    <tr><td class="paramtype"></td><td class="paramname">$content_status</td><td></td></tr>
    <tr><td class="paramtype">bool</td><td class="paramname">$use_all_versions</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>int </dd></dl>

<p>Definition at line <a class="el" href="../../d6/dfd/utils__cms_8php_source.html#l00084">84</a> of file <a class="el" href="../../d6/dfd/utils__cms_8php_source.html">utils_cms.php</a>.</p>

<p>References <a class="el" href="../../d5/d3e/ajax__autocomplete__parent__title_8php_source.html#l00026">$conn</a>, <a class="el" href="../../d7/da6/ajax__datetime__range_8php_source.html#l00026">$dt</a>, <a class="el" href="../../d0/d3d/ajax__new__page_8php_source.html#l00037">$rs</a>, and <a class="el" href="../../d0/d3d/ajax__new__page_8php_source.html#l00036">$sql</a>.</p>
<div class="fragment"><div class="line">                                                                                            {</div>
<div class="line"></div>
<div class="line">        $page_version = 0;</div>
<div class="line"></div>
<div class="line">        $dt_safe = <a class="code" href="../../d5/d3e/ajax__autocomplete__parent__title_8php.html#aa8a5a87b9c1a6a0819b88447cbe41877">$conn</a>-&gt;qstr(<a class="code" href="../../d7/da6/ajax__datetime__range_8php.html#a749423b4cd05e9c9af3474b05bec92c2">$dt</a>);</div>
<div class="line"></div>
<div class="line">        <a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a047170d6020a882807665812a27e2525">$sql</a> = <span class="stringliteral">&#39;SELECT id FROM www_page_versions &#39;</span> .</div>
<div class="line">                <span class="stringliteral">&#39;WHERE www_pages_id=&#39;</span> . $page_id .</div>
<div class="line">                <span class="stringliteral">&#39; AND lk_content_status_id=&#39;</span> . $content_status .</div>
<div class="line">                <span class="stringliteral">&#39; AND date_publish_start&lt;=&#39;</span> . $dt_safe .</div>
<div class="line">                <span class="stringliteral">&#39; AND (date_publish_end IS NULL OR date_publish_end&gt;&#39;</span> . $dt_safe . <span class="charliteral">&#39;)&#39;</span> .</div>
<div class="line">                <span class="stringliteral">&#39; ORDER BY date_publish_start DESC&#39;</span>;</div>
<div class="line">        <a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a801399e74a9ffbd3985c323da20bb59e">$rs</a> = <a class="code" href="../../d5/d3e/ajax__autocomplete__parent__title_8php.html#aa8a5a87b9c1a6a0819b88447cbe41877">$conn</a>-&gt;SelectLimit(<a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a047170d6020a882807665812a27e2525">$sql</a>, 1, 0);</div>
<div class="line">        <span class="keywordflow">if</span>(<a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a801399e74a9ffbd3985c323da20bb59e">$rs</a> === <span class="keyword">false</span>) {</div>
<div class="line">                trigger_error(<span class="stringliteral">&#39;Wrong SQL: &#39;</span> . <a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a047170d6020a882807665812a27e2525">$sql</a> . <span class="stringliteral">&#39; Error: &#39;</span> . <a class="code" href="../../d5/d3e/ajax__autocomplete__parent__title_8php.html#aa8a5a87b9c1a6a0819b88447cbe41877">$conn</a>-&gt;ErrorMsg(), E_USER_ERROR);</div>
<div class="line">        }</div>
<div class="line"></div>
<div class="line">        $page_version = (<a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a801399e74a9ffbd3985c323da20bb59e">$rs</a>-&gt;RecordCount() == 0) ? 0 : <a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a801399e74a9ffbd3985c323da20bb59e">$rs</a>-&gt;fields[<span class="stringliteral">&#39;id&#39;</span>];</div>
<div class="line"></div>
<div class="line">        <span class="keywordflow">if</span>($page_version == 0 &amp;&amp; $use_all_versions) {</div>
<div class="line">                <a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a047170d6020a882807665812a27e2525">$sql</a> = <span class="stringliteral">&#39;SELECT id FROM www_page_versions &#39;</span> .</div>
<div class="line">                        <span class="stringliteral">&#39;WHERE www_pages_id=&#39;</span> . $page_id .</div>
<div class="line">                        <span class="stringliteral">&#39; ORDER BY date_publish_start DESC&#39;</span>;</div>
<div class="line">                <a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a801399e74a9ffbd3985c323da20bb59e">$rs</a> = <a class="code" href="../../d5/d3e/ajax__autocomplete__parent__title_8php.html#aa8a5a87b9c1a6a0819b88447cbe41877">$conn</a>-&gt;SelectLimit(<a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a047170d6020a882807665812a27e2525">$sql</a>, 1, 0);</div>
<div class="line">                <span class="keywordflow">if</span>(<a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a801399e74a9ffbd3985c323da20bb59e">$rs</a> === <span class="keyword">false</span>) {</div>
<div class="line">                        trigger_error(<span class="stringliteral">&#39;Wrong SQL: &#39;</span> . <a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a047170d6020a882807665812a27e2525">$sql</a> . <span class="stringliteral">&#39; Error: &#39;</span> . <a class="code" href="../../d5/d3e/ajax__autocomplete__parent__title_8php.html#aa8a5a87b9c1a6a0819b88447cbe41877">$conn</a>-&gt;ErrorMsg(), E_USER_ERROR);</div>
<div class="line">                }</div>
<div class="line"></div>
<div class="line">                $page_version = (<a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a801399e74a9ffbd3985c323da20bb59e">$rs</a>-&gt;RecordCount() == 0) ? 0 : <a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a801399e74a9ffbd3985c323da20bb59e">$rs</a>-&gt;fields[<span class="stringliteral">&#39;id&#39;</span>];</div>
<div class="line">        }</div>
<div class="line"></div>
<div class="line">        <span class="keywordflow">return</span> $page_version;</div>
<div class="line">}</div>
</div><!-- fragment -->
</div>
</div>
<a class="anchor" id="af95a0717c669315235da4fb362691905"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">get_page_version_content_from_string </td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$conn</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$template_id</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$str_html</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">$conn</td><td></td></tr>
    <tr><td class="paramname">$template_id</td><td></td></tr>
    <tr><td class="paramname">$str_html</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>array </dd></dl>

<p>Definition at line <a class="el" href="../../d6/dfd/utils__cms_8php_source.html#l00341">341</a> of file <a class="el" href="../../d6/dfd/utils__cms_8php_source.html">utils_cms.php</a>.</p>

<p>References <a class="el" href="../../d7/da6/ajax__datetime__range_8php_source.html#l00031">$a_res</a>, <a class="el" href="../../d5/d3e/ajax__autocomplete__parent__title_8php_source.html#l00026">$conn</a>, <a class="el" href="../../db/d3f/ajax__addnew__page__version_8php_source.html#l00046">$html</a>, <a class="el" href="../../db/d3f/ajax__addnew__page__version_8php_source.html#l00031">$res</a>, <a class="el" href="../../d0/d3d/ajax__new__page_8php_source.html#l00037">$rs</a>, <a class="el" href="../../d0/d3d/ajax__new__page_8php_source.html#l00036">$sql</a>, and <a class="el" href="../../db/d3f/ajax__addnew__page__version_8php_source.html#l00055">$template_id</a>.</p>
<div class="fragment"><div class="line">                                                                              {</div>
<div class="line"></div>
<div class="line">        $config = HTMLPurifier_Config::createDefault();</div>
<div class="line">        $config-&gt;set(<span class="stringliteral">&#39;HTML.TidyLevel&#39;</span>, <span class="stringliteral">&#39;medium&#39;</span>);</div>
<div class="line">        $purifier = <span class="keyword">new</span> HTMLPurifier($config);</div>
<div class="line"></div>
<div class="line">        <a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a047170d6020a882807665812a27e2525">$sql</a> = <span class="stringliteral">&#39;SELECT id, element_id FROM www_template_active_elements WHERE www_templates_id=&#39;</span> . <a class="code" href="../../db/d3f/ajax__addnew__page__version_8php.html#a244cfb00f58fe64d22802920d642cf8a">$template_id</a> . <span class="stringliteral">&#39; ORDER BY display_order&#39;</span>;</div>
<div class="line">        <a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a801399e74a9ffbd3985c323da20bb59e">$rs</a> = <a class="code" href="../../d5/d3e/ajax__autocomplete__parent__title_8php.html#aa8a5a87b9c1a6a0819b88447cbe41877">$conn</a>-&gt;Execute(<a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a047170d6020a882807665812a27e2525">$sql</a>);</div>
<div class="line">        <span class="keywordflow">if</span>(<a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a801399e74a9ffbd3985c323da20bb59e">$rs</a> === <span class="keyword">false</span>) {</div>
<div class="line">                trigger_error(<span class="stringliteral">&#39;Wrong SQL: &#39;</span> . <a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a047170d6020a882807665812a27e2525">$sql</a> . <span class="stringliteral">&#39; Error: &#39;</span> . <a class="code" href="../../d5/d3e/ajax__autocomplete__parent__title_8php.html#aa8a5a87b9c1a6a0819b88447cbe41877">$conn</a>-&gt;ErrorMsg(), E_USER_ERROR);</div>
<div class="line">        }</div>
<div class="line">        $a_elements = <a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a801399e74a9ffbd3985c323da20bb59e">$rs</a>-&gt;GetRows();</div>
<div class="line"></div>
<div class="line">        <a class="code" href="../../d7/da6/ajax__datetime__range_8php.html#a021631687090fc455607ae336ebc3b54">$a_res</a> = array();</div>
<div class="line"></div>
<div class="line">        <span class="comment">// create a DOM object</span></div>
<div class="line">        <a class="code" href="../../db/d3f/ajax__addnew__page__version_8php.html#a6f96e7fc92441776c9d1cd3386663b40">$html</a> = <span class="keyword">new</span> simple_html_dom();</div>
<div class="line"></div>
<div class="line">        <span class="comment">// load template html</span></div>
<div class="line">        <a class="code" href="../../db/d3f/ajax__addnew__page__version_8php.html#a6f96e7fc92441776c9d1cd3386663b40">$html</a>-&gt;load($str_html);</div>
<div class="line"></div>
<div class="line">        <span class="keywordflow">foreach</span>($a_elements as $element) {</div>
<div class="line"></div>
<div class="line">                $element_html  = <span class="stringliteral">&#39;&#39;</span>;</div>
<div class="line">                $element_id = $element[<span class="stringliteral">&#39;id&#39;</span>];</div>
<div class="line"></div>
<div class="line">                <span class="comment">// set element content</span></div>
<div class="line">                $selector = <span class="stringliteral">&#39;[id=&#39;</span> . $element[<span class="stringliteral">&#39;element_id&#39;</span>] . <span class="charliteral">&#39;]&#39;</span>;</div>
<div class="line">                <a class="code" href="../../db/d3f/ajax__addnew__page__version_8php.html#a49a8a4009b02e49717caa88b128affc5">$res</a> = <a class="code" href="../../db/d3f/ajax__addnew__page__version_8php.html#a6f96e7fc92441776c9d1cd3386663b40">$html</a>-&gt;find($selector, 0);</div>
<div class="line">                <span class="keywordflow">if</span>(<a class="code" href="../../db/d3f/ajax__addnew__page__version_8php.html#a49a8a4009b02e49717caa88b128affc5">$res</a>) {</div>
<div class="line">                        $element_html = <a class="code" href="../../db/d3f/ajax__addnew__page__version_8php.html#a49a8a4009b02e49717caa88b128affc5">$res</a>-&gt;innertext;</div>
<div class="line">                        <span class="comment">// apply htmlpurifier</span></div>
<div class="line">                        $element_html = $purifier-&gt;purify($element_html);</div>
<div class="line">                }</div>
<div class="line"></div>
<div class="line">                array_push(<a class="code" href="../../d7/da6/ajax__datetime__range_8php.html#a021631687090fc455607ae336ebc3b54">$a_res</a>, array(<span class="stringliteral">&#39;www_template_active_elements_id&#39;</span> =&gt; $element_id , <span class="stringliteral">&#39;html&#39;</span> =&gt; $element_html));</div>
<div class="line"></div>
<div class="line">        }</div>
<div class="line"></div>
<div class="line">        <span class="keywordflow">return</span> <a class="code" href="../../d7/da6/ajax__datetime__range_8php.html#a021631687090fc455607ae336ebc3b54">$a_res</a>;</div>
<div class="line">}</div>
</div><!-- fragment -->
</div>
</div>
<a class="anchor" id="a7ceb917fb4bd67db7f6be554347747fc"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">get_template_active_elements </td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$conn</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$template_id</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Get active elements for given template</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">$conn</td><td></td></tr>
    <tr><td class="paramname">$template_id</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>array </dd></dl>

<p>Definition at line <a class="el" href="../../d6/dfd/utils__cms_8php_source.html#l00279">279</a> of file <a class="el" href="../../d6/dfd/utils__cms_8php_source.html">utils_cms.php</a>.</p>

<p>References <a class="el" href="../../de/d20/index_8php_source.html#l00129">$a_active_elements</a>, <a class="el" href="../../d5/d3e/ajax__autocomplete__parent__title_8php_source.html#l00026">$conn</a>, <a class="el" href="../../d0/d3d/ajax__new__page_8php_source.html#l00037">$rs</a>, <a class="el" href="../../d0/d3d/ajax__new__page_8php_source.html#l00036">$sql</a>, and <a class="el" href="../../db/d3f/ajax__addnew__page__version_8php_source.html#l00055">$template_id</a>.</p>
<div class="fragment"><div class="line">                                                           {</div>
<div class="line"></div>
<div class="line">        <a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a047170d6020a882807665812a27e2525">$sql</a> = <span class="stringliteral">&#39;SELECT id, element_id FROM www_template_active_elements WHERE www_templates_id=&#39;</span> . <a class="code" href="../../db/d3f/ajax__addnew__page__version_8php.html#a244cfb00f58fe64d22802920d642cf8a">$template_id</a> . <span class="stringliteral">&#39; ORDER BY display_order&#39;</span>;</div>
<div class="line">        <a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a801399e74a9ffbd3985c323da20bb59e">$rs</a> = <a class="code" href="../../d5/d3e/ajax__autocomplete__parent__title_8php.html#aa8a5a87b9c1a6a0819b88447cbe41877">$conn</a>-&gt;Execute(<a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a047170d6020a882807665812a27e2525">$sql</a>);</div>
<div class="line">        <span class="keywordflow">if</span>(<a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a801399e74a9ffbd3985c323da20bb59e">$rs</a> === <span class="keyword">false</span>) {</div>
<div class="line">                trigger_error(<span class="stringliteral">&#39;Wrong SQL: &#39;</span> . <a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a047170d6020a882807665812a27e2525">$sql</a> . <span class="stringliteral">&#39; Error: &#39;</span> . <a class="code" href="../../d5/d3e/ajax__autocomplete__parent__title_8php.html#aa8a5a87b9c1a6a0819b88447cbe41877">$conn</a>-&gt;ErrorMsg(), E_USER_ERROR);</div>
<div class="line">        }</div>
<div class="line">        $a_elements = <a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a801399e74a9ffbd3985c323da20bb59e">$rs</a>-&gt;GetRows();</div>
<div class="line"></div>
<div class="line">        <a class="code" href="../../de/d20/index_8php.html#a4cd31f10c77bc51db0a8a80f08d61ce0">$a_active_elements</a> = array();</div>
<div class="line">        <span class="keywordflow">foreach</span>($a_elements as $element) {</div>
<div class="line">                array_push(<a class="code" href="../../de/d20/index_8php.html#a4cd31f10c77bc51db0a8a80f08d61ce0">$a_active_elements</a>, <span class="charliteral">&#39;#&#39;</span> . $element[<span class="stringliteral">&#39;element_id&#39;</span>]);</div>
<div class="line">        }</div>
<div class="line"></div>
<div class="line">        <span class="keywordflow">return</span> <a class="code" href="../../de/d20/index_8php.html#a4cd31f10c77bc51db0a8a80f08d61ce0">$a_active_elements</a>;</div>
<div class="line">}</div>
</div><!-- fragment -->
</div>
</div>
<a class="anchor" id="a899c67acb078ad12251b58324cf23ad0"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">get_user </td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$conn</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$username</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Get current user</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">$conn</td><td></td></tr>
    <tr><td class="paramname">$username</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>array </dd></dl>

<p>Definition at line <a class="el" href="../../d6/dfd/utils__cms_8php_source.html#l00010">10</a> of file <a class="el" href="../../d6/dfd/utils__cms_8php_source.html">utils_cms.php</a>.</p>

<p>References <a class="el" href="../../d5/d3e/ajax__autocomplete__parent__title_8php_source.html#l00026">$conn</a>, <a class="el" href="../../d9/d37/ajax__load__page__version_8php_source.html#l00077">$lk_roles_id</a>, <a class="el" href="../../d0/d3d/ajax__new__page_8php_source.html#l00037">$rs</a>, <a class="el" href="../../d0/d3d/ajax__new__page_8php_source.html#l00036">$sql</a>, and <a class="el" href="../../db/ded/ajax__user_8php_source.html#l00031">$username</a>.</p>
<div class="fragment"><div class="line">                                    {</div>
<div class="line"></div>
<div class="line">        <a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a047170d6020a882807665812a27e2525">$sql</a> = <span class="stringliteral">&#39;SELECT id, email, lk_roles_id FROM www_users WHERE username=&#39;</span> . <a class="code" href="../../d5/d3e/ajax__autocomplete__parent__title_8php.html#aa8a5a87b9c1a6a0819b88447cbe41877">$conn</a>-&gt;qstr(<a class="code" href="../../db/ded/ajax__user_8php.html#a366a247cf60fc19cd385fd46c2846b86">$username</a>);</div>
<div class="line">        <a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a801399e74a9ffbd3985c323da20bb59e">$rs</a> = <a class="code" href="../../d5/d3e/ajax__autocomplete__parent__title_8php.html#aa8a5a87b9c1a6a0819b88447cbe41877">$conn</a>-&gt;Execute(<a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a047170d6020a882807665812a27e2525">$sql</a>);</div>
<div class="line">        <span class="keywordflow">if</span>(<a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a801399e74a9ffbd3985c323da20bb59e">$rs</a> === <span class="keyword">false</span>) {</div>
<div class="line">                trigger_error(<span class="stringliteral">&#39;Wrong SQL: &#39;</span> . <a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a047170d6020a882807665812a27e2525">$sql</a> . <span class="stringliteral">&#39; Error: &#39;</span> . <a class="code" href="../../d5/d3e/ajax__autocomplete__parent__title_8php.html#aa8a5a87b9c1a6a0819b88447cbe41877">$conn</a>-&gt;ErrorMsg(), E_USER_ERROR);</div>
<div class="line">        }</div>
<div class="line">        $user_id = <a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a801399e74a9ffbd3985c323da20bb59e">$rs</a>-&gt;fields[<span class="stringliteral">&#39;id&#39;</span>];</div>
<div class="line">        <a class="code" href="../../d9/d37/ajax__load__page__version_8php.html#a57b5c55362af42165645752e1593d407">$lk_roles_id</a> = <a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a801399e74a9ffbd3985c323da20bb59e">$rs</a>-&gt;fields[<span class="stringliteral">&#39;lk_roles_id&#39;</span>];</div>
<div class="line">        $user_email = <a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a801399e74a9ffbd3985c323da20bb59e">$rs</a>-&gt;fields[<span class="stringliteral">&#39;email&#39;</span>];</div>
<div class="line"></div>
<div class="line">        <span class="keywordflow">return</span> array(</div>
<div class="line">                <span class="stringliteral">&#39;user_id&#39;</span> =&gt; $user_id,</div>
<div class="line">                <span class="stringliteral">&#39;lk_roles_id&#39;</span> =&gt; <a class="code" href="../../d9/d37/ajax__load__page__version_8php.html#a57b5c55362af42165645752e1593d407">$lk_roles_id</a>,</div>
<div class="line">                <span class="stringliteral">&#39;user_email&#39;</span> =&gt; $user_email</div>
<div class="line">        );</div>
<div class="line"></div>
<div class="line">}</div>
</div><!-- fragment -->
</div>
</div>
<a class="anchor" id="ab025d281a8114b37826d621f93b8fb70"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">parse_template_head </td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$html</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$template_base_url</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Parse template head</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">$html</td><td></td></tr>
    <tr><td class="paramname">$template_base_url</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>array </dd></dl>

<p>Definition at line <a class="el" href="../../d6/dfd/utils__cms_8php_source.html#l00225">225</a> of file <a class="el" href="../../d6/dfd/utils__cms_8php_source.html">utils_cms.php</a>.</p>

<p>References <a class="el" href="../../db/d3f/ajax__addnew__page__version_8php_source.html#l00046">$html</a>, <a class="el" href="../../d9/d37/ajax__load__page__version_8php_source.html#l00181">$template_base_url</a>, <a class="el" href="../../de/d20/index_8php_source.html#l00123">$template_favicon_html</a>, <a class="el" href="../../de/d20/index_8php_source.html#l00124">$template_link_html</a>, <a class="el" href="../../de/d20/index_8php_source.html#l00126">$template_meta_html</a>, <a class="el" href="../../de/d20/index_8php_source.html#l00125">$template_scripts_html</a>, and <a class="el" href="../../de/dc4/settings_8dist_8php_source.html#l00011">$tolc_conf</a>.</p>
<div class="fragment"><div class="line">                                                        {</div>
<div class="line"></div>
<div class="line">        global <a class="code" href="../../de/dc4/settings_8dist_8php.html#af21c418e4c577deb3a9ea7299156ae35">$tolc_conf</a>;</div>
<div class="line"></div>
<div class="line">        <span class="comment">// convert template head &lt;link&gt; href relevant to website root and collect &lt;link&gt; tags</span></div>
<div class="line">        <a class="code" href="../../de/d20/index_8php.html#ae777e53a7768c7b22ebe798c01b4e54d">$template_favicon_html</a> = <span class="stringliteral">&#39;&#39;</span>;</div>
<div class="line">        <a class="code" href="../../de/d20/index_8php.html#a3ad836e608dcc6dc42762a0c35a2366b">$template_link_html</a> = <span class="stringliteral">&#39;&#39;</span>;</div>
<div class="line">        $template_links = <a class="code" href="../../db/d3f/ajax__addnew__page__version_8php.html#a6f96e7fc92441776c9d1cd3386663b40">$html</a>-&gt;find(<span class="stringliteral">&#39;link&#39;</span>);</div>
<div class="line">        <span class="keywordflow">foreach</span>($template_links as $template_link) {</div>
<div class="line">                $link_rel = $template_link-&gt;rel;</div>
<div class="line">                $link_href = $template_link-&gt;href;</div>
<div class="line">                $link_href_modified = <a class="code" href="../../d9/d37/ajax__load__page__version_8php.html#a31474d1b2daf374055a779407b85e01f">$template_base_url</a> . $link_href;</div>
<div class="line">                $template_link_tag = $template_link-&gt;outertext;</div>
<div class="line">                $template_link_tag = implode($link_href_modified, mb_split($link_href, $template_link_tag));</div>
<div class="line">                <span class="keywordflow">if</span>($link_rel == <span class="stringliteral">&#39;shortcut icon&#39;</span>) {</div>
<div class="line">                        <a class="code" href="../../de/d20/index_8php.html#ae777e53a7768c7b22ebe798c01b4e54d">$template_favicon_html</a> = $template_link_tag;</div>
<div class="line">                } <span class="keywordflow">else</span> {</div>
<div class="line">                        <a class="code" href="../../de/d20/index_8php.html#a3ad836e608dcc6dc42762a0c35a2366b">$template_link_html</a> .= $template_link_tag;</div>
<div class="line">                }</div>
<div class="line">        }</div>
<div class="line"></div>
<div class="line">        <span class="comment">// convert template head &lt;script&gt; src relevant to website root and collect &lt;script&gt; tags</span></div>
<div class="line">        <a class="code" href="../../de/d20/index_8php.html#a283004c24435a04b02a95d0412c0866d">$template_scripts_html</a> = <span class="stringliteral">&#39;&#39;</span>;</div>
<div class="line">        $template_scripts = <a class="code" href="../../db/d3f/ajax__addnew__page__version_8php.html#a6f96e7fc92441776c9d1cd3386663b40">$html</a>-&gt;find(<span class="stringliteral">&#39;script&#39;</span>);</div>
<div class="line">        <span class="keywordflow">foreach</span>($template_scripts as $template_script) {</div>
<div class="line">                $script_src = $template_script-&gt;src;</div>
<div class="line">                $script_src_modified = <a class="code" href="../../d9/d37/ajax__load__page__version_8php.html#a31474d1b2daf374055a779407b85e01f">$template_base_url</a> . $script_src;</div>
<div class="line">                $template_script_tag = $template_script-&gt;outertext;</div>
<div class="line">                $template_script_tag = implode($script_src_modified, mb_split($script_src, $template_script_tag));</div>
<div class="line">                <a class="code" href="../../de/d20/index_8php.html#a283004c24435a04b02a95d0412c0866d">$template_scripts_html</a> .= $template_script_tag;</div>
<div class="line">        }</div>
<div class="line"></div>
<div class="line">        <span class="comment">// collect template &lt;meta&gt; tags</span></div>
<div class="line">        <a class="code" href="../../de/d20/index_8php.html#a339f5e050c43eedaf57606d54acf2d1f">$template_meta_html</a> = <span class="stringliteral">&#39;&#39;</span>;</div>
<div class="line">        $template_meta_tags = <a class="code" href="../../db/d3f/ajax__addnew__page__version_8php.html#a6f96e7fc92441776c9d1cd3386663b40">$html</a>-&gt;find(<span class="stringliteral">&#39;meta&#39;</span>);</div>
<div class="line">        <span class="keywordflow">foreach</span>($template_meta_tags as $template_meta_tag) {</div>
<div class="line">                <a class="code" href="../../de/d20/index_8php.html#a339f5e050c43eedaf57606d54acf2d1f">$template_meta_html</a> .= $template_meta_tag-&gt;outertext;</div>
<div class="line">        }</div>
<div class="line"></div>
<div class="line">        <span class="keywordflow">return</span> array(</div>
<div class="line">                <span class="stringliteral">&#39;template_favicon_html&#39;</span> =&gt; <a class="code" href="../../de/d20/index_8php.html#ae777e53a7768c7b22ebe798c01b4e54d">$template_favicon_html</a>,</div>
<div class="line">                <span class="stringliteral">&#39;template_link_html&#39;</span> =&gt; <a class="code" href="../../de/d20/index_8php.html#a3ad836e608dcc6dc42762a0c35a2366b">$template_link_html</a>,</div>
<div class="line">                <span class="stringliteral">&#39;template_scripts_html&#39;</span> =&gt; <a class="code" href="../../de/d20/index_8php.html#a283004c24435a04b02a95d0412c0866d">$template_scripts_html</a>,</div>
<div class="line">                <span class="stringliteral">&#39;template_meta_html&#39;</span> =&gt; <a class="code" href="../../de/d20/index_8php.html#a339f5e050c43eedaf57606d54acf2d1f">$template_meta_html</a></div>
<div class="line">        );</div>
<div class="line">}</div>
</div><!-- fragment -->
</div>
</div>
<a class="anchor" id="af1067f0f5a7357c706ca40d229d1f4ac"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">set_page_version_content </td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$conn</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$page_version_id</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$template_id</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$html</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">$conn</td><td></td></tr>
    <tr><td class="paramname">$page_version_id</td><td></td></tr>
    <tr><td class="paramname">$template_id</td><td></td></tr>
    <tr><td class="paramname">$html</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>mixed </dd></dl>

<p>Definition at line <a class="el" href="../../d6/dfd/utils__cms_8php_source.html#l00303">303</a> of file <a class="el" href="../../d6/dfd/utils__cms_8php_source.html">utils_cms.php</a>.</p>

<p>References <a class="el" href="../../d5/d3e/ajax__autocomplete__parent__title_8php_source.html#l00026">$conn</a>, <a class="el" href="../../db/d3f/ajax__addnew__page__version_8php_source.html#l00046">$html</a>, <a class="el" href="../../db/d3f/ajax__addnew__page__version_8php_source.html#l00031">$res</a>, <a class="el" href="../../d0/d3d/ajax__new__page_8php_source.html#l00037">$rs</a>, <a class="el" href="../../d0/d3d/ajax__new__page_8php_source.html#l00036">$sql</a>, and <a class="el" href="../../db/d3f/ajax__addnew__page__version_8php_source.html#l00055">$template_id</a>.</p>
<div class="fragment"><div class="line">                                                                                {</div>
<div class="line"></div>
<div class="line">        <a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a047170d6020a882807665812a27e2525">$sql</a> = <span class="stringliteral">&#39;SELECT id, element_id FROM www_template_active_elements WHERE www_templates_id=&#39;</span> . <a class="code" href="../../db/d3f/ajax__addnew__page__version_8php.html#a244cfb00f58fe64d22802920d642cf8a">$template_id</a> . <span class="stringliteral">&#39; ORDER BY display_order&#39;</span>;</div>
<div class="line">        <a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a801399e74a9ffbd3985c323da20bb59e">$rs</a> = <a class="code" href="../../d5/d3e/ajax__autocomplete__parent__title_8php.html#aa8a5a87b9c1a6a0819b88447cbe41877">$conn</a>-&gt;Execute(<a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a047170d6020a882807665812a27e2525">$sql</a>);</div>
<div class="line">        <span class="keywordflow">if</span>(<a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a801399e74a9ffbd3985c323da20bb59e">$rs</a> === <span class="keyword">false</span>) {</div>
<div class="line">                trigger_error(<span class="stringliteral">&#39;Wrong SQL: &#39;</span> . <a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a047170d6020a882807665812a27e2525">$sql</a> . <span class="stringliteral">&#39; Error: &#39;</span> . <a class="code" href="../../d5/d3e/ajax__autocomplete__parent__title_8php.html#aa8a5a87b9c1a6a0819b88447cbe41877">$conn</a>-&gt;ErrorMsg(), E_USER_ERROR);</div>
<div class="line">        }</div>
<div class="line">        $a_elements = <a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a801399e74a9ffbd3985c323da20bb59e">$rs</a>-&gt;GetRows();</div>
<div class="line"></div>
<div class="line">        <span class="keywordflow">foreach</span>($a_elements as $element) {</div>
<div class="line"></div>
<div class="line">                <span class="comment">// get content</span></div>
<div class="line">                <a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a047170d6020a882807665812a27e2525">$sql</a> = <span class="stringliteral">&#39;SELECT html FROM www_content &#39;</span> .</div>
<div class="line">                        <span class="stringliteral">&#39;WHERE www_page_versions_id=&#39;</span> . $page_version_id .</div>
<div class="line">                        <span class="stringliteral">&#39; AND www_template_active_elements_id=&#39;</span> . $element[<span class="stringliteral">&#39;id&#39;</span>];</div>
<div class="line">                <a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a801399e74a9ffbd3985c323da20bb59e">$rs</a> = <a class="code" href="../../d5/d3e/ajax__autocomplete__parent__title_8php.html#aa8a5a87b9c1a6a0819b88447cbe41877">$conn</a>-&gt;Execute(<a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a047170d6020a882807665812a27e2525">$sql</a>);</div>
<div class="line">                <span class="keywordflow">if</span>(<a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a801399e74a9ffbd3985c323da20bb59e">$rs</a> === <span class="keyword">false</span>) {</div>
<div class="line">                        trigger_error(<span class="stringliteral">&#39;Wrong SQL: &#39;</span> . <a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a047170d6020a882807665812a27e2525">$sql</a> . <span class="stringliteral">&#39; Error: &#39;</span> . <a class="code" href="../../d5/d3e/ajax__autocomplete__parent__title_8php.html#aa8a5a87b9c1a6a0819b88447cbe41877">$conn</a>-&gt;ErrorMsg(), E_USER_ERROR);</div>
<div class="line">                }</div>
<div class="line">                <span class="keywordflow">if</span>(<a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a801399e74a9ffbd3985c323da20bb59e">$rs</a>-&gt;RecordCount() == 1) {</div>
<div class="line">                        <span class="comment">// set element content</span></div>
<div class="line">                        $selector = <span class="stringliteral">&#39;[id=&#39;</span> . $element[<span class="stringliteral">&#39;element_id&#39;</span>] . <span class="charliteral">&#39;]&#39;</span>;</div>
<div class="line">                        <a class="code" href="../../db/d3f/ajax__addnew__page__version_8php.html#a49a8a4009b02e49717caa88b128affc5">$res</a> = <a class="code" href="../../db/d3f/ajax__addnew__page__version_8php.html#a6f96e7fc92441776c9d1cd3386663b40">$html</a>-&gt;find($selector, 0);</div>
<div class="line">                        <span class="keywordflow">if</span>(<a class="code" href="../../db/d3f/ajax__addnew__page__version_8php.html#a49a8a4009b02e49717caa88b128affc5">$res</a>) {</div>
<div class="line">                                <a class="code" href="../../db/d3f/ajax__addnew__page__version_8php.html#a49a8a4009b02e49717caa88b128affc5">$res</a>-&gt;innertext = <a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a801399e74a9ffbd3985c323da20bb59e">$rs</a>-&gt;fields[<span class="stringliteral">&#39;html&#39;</span>];</div>
<div class="line">                        }</div>
<div class="line">                }</div>
<div class="line">        }</div>
<div class="line"></div>
<div class="line">        <span class="keywordflow">return</span> <a class="code" href="../../db/d3f/ajax__addnew__page__version_8php.html#a6f96e7fc92441776c9d1cd3386663b40">$html</a>;</div>
<div class="line">}</div>
</div><!-- fragment -->
</div>
</div>
<a class="anchor" id="a6b786ebb8257b1815166cdaa1f7f1a2c"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">set_template_src_attribute </td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$html</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$template_base_url</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">$html</td><td></td></tr>
    <tr><td class="paramname">$template_base_url</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>mixed </dd></dl>

<p>Definition at line <a class="el" href="../../d6/dfd/utils__cms_8php_source.html#l00199">199</a> of file <a class="el" href="../../d6/dfd/utils__cms_8php_source.html">utils_cms.php</a>.</p>

<p>References <a class="el" href="../../db/d3f/ajax__addnew__page__version_8php_source.html#l00046">$html</a>, and <a class="el" href="../../d9/d37/ajax__load__page__version_8php_source.html#l00181">$template_base_url</a>.</p>
<div class="fragment"><div class="line">                                                               {</div>
<div class="line"></div>
<div class="line">        <span class="comment">// convert template &lt;img&gt; src relevant to website root</span></div>
<div class="line">        $template_images = <a class="code" href="../../db/d3f/ajax__addnew__page__version_8php.html#a6f96e7fc92441776c9d1cd3386663b40">$html</a>-&gt;find(<span class="stringliteral">&#39;img[src]&#39;</span>);</div>
<div class="line">        <span class="keywordflow">foreach</span>($template_images as $template_image) {</div>
<div class="line">                $img_src = $template_image-&gt;src;</div>
<div class="line">                $template_image-&gt;src = <a class="code" href="../../d9/d37/ajax__load__page__version_8php.html#a31474d1b2daf374055a779407b85e01f">$template_base_url</a> . $img_src;</div>
<div class="line">        }</div>
<div class="line"></div>
<div class="line"><span class="comment">// convert template &lt;input&gt; src relevant to website root</span></div>
<div class="line">        $template_inputs = <a class="code" href="../../db/d3f/ajax__addnew__page__version_8php.html#a6f96e7fc92441776c9d1cd3386663b40">$html</a>-&gt;find(<span class="stringliteral">&#39;input[src]&#39;</span>);</div>
<div class="line">        <span class="keywordflow">foreach</span>($template_inputs as $template_input) {</div>
<div class="line">                $input_src = $template_input-&gt;src;</div>
<div class="line">                $template_input-&gt;src = <a class="code" href="../../d9/d37/ajax__load__page__version_8php.html#a31474d1b2daf374055a779407b85e01f">$template_base_url</a> . $input_src;</div>
<div class="line">        }</div>
<div class="line"></div>
<div class="line">        <span class="keywordflow">return</span> <a class="code" href="../../db/d3f/ajax__addnew__page__version_8php.html#a6f96e7fc92441776c9d1cd3386663b40">$html</a>;</div>
<div class="line">}</div>
</div><!-- fragment -->
</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="../../dir_d422163b96683743ed3963d4aac17747.html">app</a></li><li class="navelem"><a class="el" href="../../dir_4a9513260508d5894bea9849c69369f8.html">common</a></li><li class="navelem"><a class="el" href="../../d6/dfd/utils__cms_8php.html">utils_cms.php</a></li>
    <li class="footer">Generated on Fri Aug 31 2012 22:06:31 for Tolc by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="../../doxygen.png" alt="doxygen"/></a> 1.8.2 </li>
  </ul>
</div>
</body>
</html>
